var undo={
    data(){
        return {
            cmd_undo_elements:null                    
        }
    },
    methods:{
        cmd_undo_do:function(){    
            if(!this.cmd_redo_elements[`${this.activePageIndex}`]) this.cmd_redo_elements[`${this.activePageIndex}`]=[];         
            this.itemsInstanceUnChkSel(this.activePageIndex);		
			this.clearSVG();
			this.pages[this.activePageIndex].items=[];	
			var data=this.cmd_records_elements[`${this.activePageIndex}`].pop();				
			if(data){				
                this.cmd_redo_elements[`${this.activePageIndex}`].push(JSON.stringify(data.v));
				for(var i=0;i<data.v.length;i++){					
					this.renderItem(this.pages[this.activePageIndex],data.v[i]);
				}				
            }            
            this.cmdActive['undo']=this.cmd_records_elements[`${this.activePageIndex}`].length>0;
            this.cmdActive['redo']=this.cmd_redo_elements[`${this.activePageIndex}`].length>0;
        },
        cmd_undo_active:function(){
            
        }
    }
}

export default undo;
